/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package motiveai.tests;

import motiveai.components.Agent;
import motiveai.components.SensorEntity;
import motiveai.factors.Environment;


/**
 *
 * @author oxplay
 */
public class Test1Sensor extends SensorEntity<Agent> {

    long lastAddedEnemy = System.currentTimeMillis();

    @Override
    protected void examEnvironment(Agent agent, Environment environment) {
        long actualTime = System.currentTimeMillis();
        if (Math.abs(actualTime - lastAddedEnemy) > 5000) {
            lastAddedEnemy = actualTime;
            System.out.println("adding Enemy!");
            environment.setBooleanFactor("isEnemyNear", true);
        }
    }

}
